#include <iostream>
using namespace std;

class counter
{
    int value;
    
    public:
        counter(int num = 0);
        void increment();
        void decrement();
        int getvalue();
        void print();

};
counter::counter(int num)
{value = num;}
void counter::increment()
{value ++;}
void counter::decrement()
{value --;}
int counter::getvalue()
{return value;}
void counter::print()
{cout<<"Conter's value is:"<<value<<endl;}

int main()
{
    counter ct(0);
    int top,low;
    for(int i = 1;i <= 20;i++)
    {
        ct.increment();
        ct.print();
        top = ct.getvalue();
    }
    for(int i=1;i<=20;i++)
    {
        ct.decrement();
        ct.print();
        low = ct.getvalue();
    }
    cout<<"top = "<<top<<"low = "<<low<<endl;
    cin.get();
    return 0;
}